#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "BaseNetRequestMacros.h"
NS_ASSUME_NONNULL_BEGIN
typedef void(^_Nullable BaseNetRequestSuccessBlock)(id responseObject);
typedef void(^_Nullable BaseNetRequestFailureBlock)(NSError *error);
typedef void (^_Nullable BaseNetRequestUploadProgressBlock)(NSProgress * _Nullable progress);
typedef NSURL * _Nullable (^_Nullable BaseNetRequestDestinationBlock)(NSURL *targetPath, NSURLResponse *response);
typedef void (^ _Nullable BaseNetRequestDownLoadSuccessBlock)(NSURLResponse * _Nonnull response, NSURL * _Nullable filePath);
@interface BaseNetRequest : NSObject
+ (NSString*)encode:(NSData *)data;
+ (instancetype)sharedInstance;
@property (nonatomic ,copy) NSString *BaseUrl;
#pragma mark - net monitor
+(void)startNetMonitoring;
+(void)stopNetMonitoring;
#pragma mark - Parameter
-(void)updateSessionManagerHeaderFields:(NSDictionary *)sessionManagerParameters timeoutInterval:(NSTimeInterval)timeoutInterval;
-(void)updateSessionManagerHeaderFields:(NSDictionary *)sessionManagerParameters;
#pragma mark - Function
- (void)requestWithType:(RequestType)type
                    url:(NSString *)urlString
             parameters:(nullable id)parameters
                success:(BaseNetRequestSuccessBlock)success
                failure:(BaseNetRequestFailureBlock)failure;
- (void)postWithFullUrl:(NSString *)fullURLString parameters:(nullable id)parameters success:(BaseNetRequestSuccessBlock )success failure:(BaseNetRequestFailureBlock )failure;
- (void)getWithFullUrl:(NSString *)fullURLString parameters:(nullable id)parameters success:(BaseNetRequestSuccessBlock )success failure:(BaseNetRequestFailureBlock )failure;
- (void)putWithFullUrl:(NSString *)fullURLString parameters:(nullable id)parameters success:(BaseNetRequestSuccessBlock )success failure:(BaseNetRequestFailureBlock )failure;
-(void)cancelDataTask;
#pragma mark - upload
-(void)upLoadWithPOST:(NSString *)urlString
           parameters:(nullable id)parameters
                image:(NSData *)img
             progress:(BaseNetRequestUploadProgressBlock )progress
              success:(BaseNetRequestSuccessBlock)success
              failure:(BaseNetRequestFailureBlock)failure;
-(void)upLoadWithPOST:(NSString *)urlString
           parameters:(nullable id)parameters
                image:(NSData *)img
            imageName:(NSString *)imageName
             fileName:(NSString *)fileName
             progress:(BaseNetRequestUploadProgressBlock )progress
              success:(BaseNetRequestSuccessBlock)success
              failure:(BaseNetRequestFailureBlock)failure;
-(void)upLoadWithPOST:(NSString *)urlString
           parameters:(nullable id)parameters
           imageArray:(NSArray *)imageArray
             progress:(BaseNetRequestUploadProgressBlock )progress
              success:(BaseNetRequestSuccessBlock)success
              failure:(BaseNetRequestFailureBlock)failure;
-(void)cancelUploadTask;
#pragma mark - download 
- (void)downLoadWithURL:(NSString *)fullURLString progress:(BaseNetRequestSuccessBlock)progress destination:(BaseNetRequestDestinationBlock )destination downLoadSuccess:(BaseNetRequestDownLoadSuccessBlock )downLoadSuccess failure:(BaseNetRequestFailureBlock)failure;
-(void)cancelDownloadTask;
@end
NS_ASSUME_NONNULL_END
